import Vue from 'vue';
import axios from 'axios';
let baseUrl="https://api.huobi.pro/market/";

export const ask = (url,params={},method='get') => {

  if(method=='get'){
    return axios.get(baseUrl+url,{params:params}).then((data) => {

         return data.data;

    })
  }else if(method=='post'){

      return axios.post(baseUrl+url,params,{
        headers: {
          'content-type': 'application/json'
        }
      }).then((data) => {

          return data.data;

      })

  }else{
    console.log("请求方式有问题");
  }

};
